import { http } from '@/utils/http'
import type { PageData } from '@/types/global'
import type {
  IstoreItem,
  IstorePageParam,
  IstoreCollectParam,
  IStoreCollectParam,
} from '@/types/store'

export const pageStoreAPI = (data: IstorePageParam) => {
  return http<PageData<IstoreItem[]>>({
    method: 'POST',
    url: `/sys/app/store/appPage`,
    data,
  })
}
export const pageStoreCollectAPI = (data: IstorePageParam) => {
  return http<PageData<IstoreItem[]>>({
    method: 'POST',
    url: `/sys/app/store/appCollectPage`,
    data,
  })
}
export const detailStoreAPI = (id: string) => {
  return http<IstoreItem>({
    method: 'GET',
    url: '/sys/app/store/detail/' + id,
    data: {},
  })
}

export const getStoreCollectStatusAPI = (data: IStoreCollectParam) => {
  return http<number>({
    method: 'POST',
    url: '/sys/app/store/status',
    data,
  })
}
export const editStoreStatusAPI = (data: IstoreCollectParam) => {
  return http<string>({
    method: 'POST',
    url: '/sys/app/store/editStatus',
    data,
  })
}
